import { ElNotification } from "element-plus";
import { BaseComponentStyleStr } from "../../type";

export interface MessageOptions {
	title: string;
	message: string;
	type?: BaseComponentStyleStr;
}

class Message {
	/**
	 * 弹出层配置项
	 * @param options
	 */
	open(options: MessageOptions) {
		ElNotification({
			title: options.title,
			message: options.message,
			type: options.type || "info",
		} as MessageOptions);
	}
}

const message = new Message();
export { message };
